package com.suray.type;

/**
 * 6代车导航类型
 */
public enum Rgv60TaskType {
    INVALID(-1, "无效"),
    NO_NAVIGATE(0, "没有导航"),
    FREEDOM_NAVIGATE(1, "自由导航到任意点"),
    AUTO_ROUTE_NAVIGATE(2, "自由导航到站点"),
    ROUTE_NAVIGATE(3, "路径导航到站点"),
    TURN(7, "平动转动"),
    OTHER(100, "其他"),
    ;

    Integer value;
    String des;
    Rgv60TaskType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return des;
    }

    public static Rgv60TaskType parseValue(Integer value) {
        if (value == null) {
            return INVALID;
        }

        for (Rgv60TaskType rgv60TaskType : Rgv60TaskType.values()) {
            if (rgv60TaskType.value.equals(value)) {
                return rgv60TaskType;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
